package com.liangzhong.modules.compete.command
{
	import com.liangzhong.proxy.compete.CompeteProxy;
	import com.liangzhong.proxyconstant.compete.CompeteProxyConstant;
	
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	public class CompeteCommand extends SimpleCommand
	{
		public function CompeteCommand()
		{
			super();
		}
		override public function execute(notification:INotification):void
		{
			switch(notification.getName())
			{
				case CompeteProxyConstant.COMPETE_MEDIATORTOCOMMAND:
					mediatorNotification(notification);
					break;
			}
		}
		/**
		 * clubMediator -->clubCommand 通知
		 * @param notification
		 * 
		 */		
		private function mediatorNotification(notification:INotification):void
		{
			var proxy:CompeteProxy = facade.retrieveProxy(CompeteProxy.PROXYNAME) as CompeteProxy;
			switch(notification.getType())
			{
				case CompeteProxyConstant.KINGANDSENIOR:
					proxy.kingAndCompetesenior(notification.getBody());
					break;
				case CompeteProxyConstant.ISSUSTASK:
					proxy.requestIssusTask(notification.getBody());
					break;
				case CompeteProxyConstant.SELECTCHALLENGENATION:
					proxy.requestselectchallengenation(notification.getBody());
					break;
				case CompeteProxyConstant.COMPETEMATCH:
					proxy.requestCompeteMatch(notification.getBody());
					break;
				case CompeteProxyConstant.BUYTREASURY:
					proxy.requestbuy(notification.getBody());
					break;
				case CompeteProxyConstant.COMPETEINFO:
					proxy.requestCompeteInfo();
					break;
				case CompeteProxyConstant.DONATE:
					proxy.requestdonate(notification.getBody());
					break;
				case CompeteProxyConstant.OTHER_INFO:
					proxy.requestOtherInfo(notification.getBody());
					break;
				case CompeteProxyConstant.MOREINLANDRANK:
					proxy.requestMoreInlandRank(notification.getBody());
					break;
				case CompeteProxyConstant.GETTREASURYFUNDS:
					proxy.requesttreasuryfunds();
					break;
			}
		}
	}
}